Closed-loop control of oxygen supplementation by O2matic